package itdep.domain.common;

import itdep.domain.CodedEntity;
import itdep.domain.TranslationType;
import itdep.domain.address.City;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import javax.persistence.*;

/**
 * @author Ivan Khalopik
 * @version $Revision: 13 $ $Date: 2010-06-16 13:04:42 +0000 (Wed, 16 Jun 2010) $
 */
@Entity
@Table(name = "EDUCATION_INSTITUTION")
public class EducationInstitution extends CodedEntity {

	@Type(type = "ga.hibernate.OrderedEnumUserType", parameters = {@Parameter(name = "enumClass", value = "itdep.domain.common.EducationInstitutionType")})
	@Column(name = "EDUCATION_INSTITUTION_TYPE", nullable = false)
	private EducationInstitutionType type;

	@ManyToOne
	@JoinColumn(name = "ID_CITY", nullable = false)
	private City city;

	public EducationInstitution() {
		super("education-institution", TranslationType.STANDARD);
	}

	public EducationInstitutionType getType() {
		return type;
	}

	public void setType(EducationInstitutionType type) {
		this.type = type;
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}
}
